﻿<table id="mumResults">
        <tr>
@*            <th>Client Name</th>*@
            <th>Branch Name</th>
            <th>Visit Name</th>
            <th>Status</th>
            <th>Assigned User</th>
            <th>Valid Dates</th>
            <th>Valid Times</th>
            <th>Planned Date and Time</th>
            <th>Actual Date</th>
            <th>Actual Times</th>
            <th>Actions</th>
        </tr>

        @foreach (var assignment in ViewBag.AssignmentInfoList)
         {

           <tr>
@*                <td>
                    @Html.Raw(assignment.ClientLabel)
                </td>*@
                <td>
                    @Html.Raw(assignment.Branch.Name)
                </td>
                <td>
                    @Html.Raw(assignment.Label)
                </td>
                <td>
                    @Html.Encode(assignment.AssignmentStatusTypeGuid)
                </td>
                <td>
                    @if (assignment.UserGuid == null)
                    {
                        Html.Encode("-");
                    }
                    else
                    {
                        Html.Encode(assignment.User.ToString());
                    }
                    
                </td>
                <td>
                    @Html.Encode(assignment.ValidStartDateTime.ToString("dd-MMM-yyyy").ToUpper()) - @Html.Encode(assignment.ValidEndDateTime.ToString("dd-MMM-yyyy").ToUpper())
                </td>
                <td>
                    @Html.Encode(assignment.ValidStartDateTime.ToString("h:mm tt")) - @Html.Encode(assignment.ValidEndDateTime.ToString("h:mm tt"))
                </td>
                <td>
                    @Html.Encode(assignment.PlannedDateTime.ToString("dd-MMM-yyyy").ToUpper().Replace("01-JAN-0001", "-"))
                </td>
                <td>
                    @Html.Encode(assignment.ActualStartDateTime.ToString("dd-MMM-yyyy").ToUpper().Replace("01-JAN-0001", "-"))
                </td>
                <td>
                    @Html.Encode(assignment.ActualStartDateTime.ToString("h:mm tt")) - @Html.Encode(assignment.ActualEndDateTime.ToString("h:mm tt"))
                </td>
                <td>
                    @if (assignment.CanTransition("Release"))
                    {
                        <a id="releaseLink" href="javascript:alert('Release option selected');">Release</a>
                    }
                    @if (assignment.CanTransition("Assign"))
                    {
                        <a id="showAssignDialog" href="javascript:ShowAssignDialog('@assignment.GUID', '@assignment.VersionId');">Assign</a>
                    }
                    @if (assignment.CanTransition("StartDataEntry"))
                    {
                        <a id="showDataEntryDialog" href="javascript:alert('Data Enter option selected');">Data Enter</a>
                    }
                    @*@if (assignment.CanTransition("StartQADataEntry"))
                    {
                        <a id="showQADialog" href="javascript:alert('QA option selected');">QA</a>
                    }
                    @if (assignment.CanTransition("Unassign"))
                    {
                        <a id="showUnassignDialog" href="javascript:alert('Unassign option selected');">Unassign</a>
                    }
                     @if (assignment.CanTransition("MarkReadyForTransfer"))
                    {
                        <a id="markReadyForTransferLink" href="javascript:alert('Mark For Transfer option selected');">Mark For Transfer</a>
                    }
                    @if (assignment.CanTransition("Reshop"))
                    {
                        <a id="showReshopDialog" href="javascript:alert('Reshop option selected');">Reshop</a>
                    }*@

                </td>
            </tr>
         }

    </table>
